package edu.gatech.oad;

import java.util.ArrayList;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.widget.Button;

public class MainActivity extends Activity {

	public static ArrayList<Item> gblItemList;
	public static boolean gblFiltered;
	@Override
	protected void onCreate(Bundle savedInstanceState) {		
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		gblItemList = new ArrayList<Item>();
		gblFiltered = false;
	}

	public void onClick(View view) {
		switch (view.getId()) {
		//switches to create new lost item view
		case R.id.addItemButton:
			startActivity(new Intent(MainActivity.this, CreateItemScreen.class));
			break;
		//switches to lost item list view
		case R.id.btnLostItems:
			System.out.println("Starting list item activity");
			startActivity(new Intent(MainActivity.this, ItemList.class));
			break;
		//launches Google Maps
		case R.id.ViewMapButton:
			System.out.println("Launching Google Maps v2 API");
			startActivity(new Intent(MainActivity.this, GoogleMapActivity.class));
			break;
			//logs out of application
		case R.id.logout_button:
			startActivity(new Intent(MainActivity.this, LoginActivity.class));
			break;
		}
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}

}
